import request from '@/utils/request'

// 获取课程、课程章节
function getSectionAndLesson (id) {
  return request({
    method: 'GET',
    url: '/boss/course/section/getSectionAndLesson',
    params: id
  })
}

// 保存或更新章节
function saveOrUpdateSection (data) {
  return request({
    method: 'POST',
    url: '/boss/course/section/saveOrUpdateSection',
    data
  })
}

// 保存或更新课时
function saveOrUpdateLesson (data) {
  return request({
    method: 'POST',
    url: '/boss/course/lesson/saveOrUpdate',
    data
  })
}

// 通过id查找章节
function getBySectionId (id) {
  return request({
    method: 'GET',
    url: '/boss/course/section/getBySectionId',
    params: id
  })
}

export {
  getSectionAndLesson,
  saveOrUpdateSection,
  saveOrUpdateLesson,
  getBySectionId
}
